import React, {Component} from 'react';
import "./index.css"
class List extends Component {
  render() {
    const { userList, isFirst, isLoading, err } = this.props;
    return (
      <div className="row">
        {
          isFirst ? <h1>请输入关键字,随后点击搜索按键</h1> : isLoading ? '搜索中.....' : err ? <h1>{ err }</h1> :
          userList.map(item => {
            return (
              <div className="card" key={ item.id }>
                <a rel="noreferrer"  href={ item.html_url } target="_blank">
                  <img src={ item.avatar_url } style={{width: '100px'}} alt="head_portrait"/>
                </a>
                <p className="card-text">{ item.login }</p>
              </div>
            )
          })
        }
      </div>
    );
  }
}

export default List;